function che=chgorl(x,cvec,crit);
% function acc=chgorl(x,cvec,crit);
% CHeck Greater OR Less than for the difference of elements 
%
% Check if all elements of x are such that 
% x(i) - x(i-1) > critvec(i) if crit ==1 
% x(i) - x(i-1) < crtivec(i) if crit == -1  
% che   =   1 if condition satisfied 
% che   =   0 otherwise 
[x,m1]=c2r(x); 
[cvec,m2]=c2r(cvec); 
if m2 ~= ( m1-1 ); 
    error('Wrong dimension of the cvec vector'); 
end 
if crit == -1 
    x = -x;
    cvec= - cvec; 
end 
che= all( ( x(2:end) - x(1:end-1) ) > cvec )  ; 

